<%@LANGUAGE="VBSCRIPT" CODEPAGE="1251"%>
<%if session("Acc")<>1 then response.Redirect "default.asp"%>
<!--#include file="../Connect/Connection.asp"-->
<%
		Set cnn=Server.CreateObject("ADODB.Connection")
		Set cmd=Server.CreateObject("ADODB.Command")
		cnn.open connStr&";Initial Catalog=sms_d"
		
		Const adCmdStoredProc = &H0004
		Const adVarChar = 200
		Const adInteger = 3
		Const adParamInput = &H0001
		Const adParamOutput = &H0002

		With cmd
			.ActiveConnection = cnn
			.CommandType = adCmdStoredProc
			.Commandtext = "sp_HTTPRequests_Add_Shops"
			.Parameters.Append .CreateParameter("@Protocol", advarchar, adParamInput,5)
			.Parameters.Append .CreateParameter("@Method", advarchar, adParamInput,4)
			.Parameters.Append .CreateParameter("@Login", advarchar, adParamInput,24)
			.Parameters.Append .CreateParameter("@Password", advarchar, adParamInput,32)
			.Parameters.Append .CreateParameter("@Host", advarchar, adParamInput,48)
			.Parameters.Append .CreateParameter("@Port", advarchar, adParamInput,5)
			.Parameters.Append .CreateParameter("@Script", advarchar, adParamInput,128)
			.Parameters.Append .CreateParameter("@Query", advarchar, adParamInput,1024)
			.Parameters.Append .CreateParameter("@ContentType", advarchar, adParamInput,36)
			.Parameters.Append .CreateParameter("@Service", advarchar, adParamInput,12)
			.Parameters.Append .CreateParameter("@CertFile", advarchar, adParamInput,50)
			.Parameters.Append .CreateParameter("@KeyFile", advarchar, adParamInput,50)
			.Parameters.Append .CreateParameter("@RootCertFile", advarchar, adParamInput,50)
			.Parameters.Append .CreateParameter("@Id_Ans", adinteger, adParamOutput)
			
			.Parameters("@Protocol")=Request.Form("Protocol")
			.Parameters("@Method")=Request.Form("Method")
			.Parameters("@Login")=Request.Form("Login")
			.Parameters("@Password")=Request.Form("Password")
			.Parameters("@Host")=Request.Form("Host")
			.Parameters("@Port")=Request.Form("Port")
			.Parameters("@Script")=Request.Form("Script")
			.Parameters("@Query")=Request.Form("Query")
			.Parameters("@ContentType")=Request.Form("ContentType")
			.Parameters("@Service")=Request.Form("Service")
			.Parameters("@CertFile")=Request.Form("CertFile")
			.Parameters("@KeyFile")=Request.Form("KeyFile")
			.Parameters("@RootCertFile")=Request.Form("RootCertFile")
			
			.Execute
		End with
		
		Answer=cmd.Parameters("@Id_Ans")
			Response.Redirect "Requests.asp?MessSh=1"
		
		set cmd=nothing
		cnn.close
		set cnn=nothing

%>
